import sys
import random

def f(n1,n2):
    year = 1
    total = n1
    while  True:
        if total>=n2:
            break
        n1 = 1.1*n1
        total  += n1
        year += 1
    return year

a=[[5000,40000]]
for i in range(9):
    x = random.randint(10,10**6)
    y = random.randint(1,30)
    a.append([x,int(x*1.1**y)])
for i  in range(10):
    fin = open('{}.in'.format(i+1),'w')
    fout = open('{}.out'.format(i+1),'w')
    print(*a[i],file=fin)
    print(f(*a[i]),file=fout)
    fin.close()
    fout.close()
